package com.usian.behavior.controller;

import com.usian.apis.behavior.ApLikesBehaviorControllerApi;
import com.usian.behavior.service.ApLikeBehaviorService;
import com.usian.model.behavior.dtos.LikesBehaviorDto;
import com.usian.model.behavior.pojos.ApLikesBehavior;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/behavior")
public class ApLikesBehaviorController implements ApLikesBehaviorControllerApi {

    @Autowired
    private ApLikeBehaviorService apLikeBehaviorService;

    @PostMapping("/likes_behavior")
    public ResponseResult like(@RequestBody LikesBehaviorDto dto) {
        return apLikeBehaviorService.like(dto);
    }

    @PostMapping("/like_query")
    public ApLikesBehavior getLike(@RequestParam Long articleId, @RequestParam Integer entryId, @RequestParam  Integer type){
        return apLikeBehaviorService.getLikeBehavior(articleId,entryId,type);
    }

}
